1. Field of the Invention
The present invention relates to an image correcting method, an image correcting apparatus and a storage medium. In particular, the present invention relates to an image correcting method for correcting the density and color of an image, an image correcting apparatus capable of applying the image correcting method, and a storage medium in which a program for executing the image correcting method in a computer is stored.
2. Description of the Related Art
Color correction such as white balance adjustment or density correction for normalizing the density of the entire image need be performed on analog image signals or image data obtained by photography using a video camera or a digital still camera. In general, the color correction and density correction of an image are performed as follows: an image signal or image data is sampled for each of a plurality of channels (for example, red, green and blue), and then, an average value is calculated for each channel based on the data for each channel obtained by the sampling. Based on the calculated average values, a correction value for the color correction and a correction value for the density correction are then determined such that the average value relating to chromaticity becomes a neutral color (gray) in the color correction and the average value relating to luminance becomes an intermediate value (a numeral such as xe2x80x9c0.75xe2x80x9d issued in the case of reflection density, and xe2x80x9c118xe2x80x9d issued in the case of image data representing the density of each pixel in 8 bits) in the density correction, thus adjusting (converting) the image signal or image data.
In this specification, besides a simple average, the term xe2x80x9can averagexe2x80x9d also generally signifies various evaluation values similar to an average value such as a value obtained by dividing the entire screen into a plurality of regions, as is the case with division photometry or evaluation photometry, calculating the average value of each region, and synthesizing the average values of each region by the use of weighting coefficients which are different for each region.
As for the color correction and density correction of the image, an improvement in correction accuracy has been demanded, and further, for example, an improvement in operational stability has been demanded, that is, that images representing similar scenes can be corrected with similar correction values or that the malfunction rate be reduced. In order to improve the operational stability and achieve stable correction results by correcting the color and density of images representing similar scenes, it is necessary to stabilize an average to be used for the calculation of the correction values for the color correction and the density correction.
In view of this, the average has been conventionally stabilized by devising an algorithm exclusively for determining the average (as disclosed, for example, in Japanese Patent Application Laid-open (JP-A) No. 3-160891). However, as for both the color correction and the density correction, it has not been easy to achieve both an improvement in correction accuracy and an improvement in operational stability at the same time. Moreover, problems, such as variations existing in the accuracy of the color correction and the density correction for each image, have also arisen.
The present invention has been accomplished in an attempt to solve the above problems experienced in the prior art. Therefore, an object of the present invention is to provide an image correcting method, an image correcting apparatus and a storage medium which enable color correction and density correction to be performed with high accuracy all the time.
Desired color correction of an image is to correct, to a neutral color, portions which were to be originally in a neutral color in an original image. As the ratio of data of the portion which should be in a neutral color included in data for obtaining the correction value for the color correction increases, the accuracy of the color correction based on the obtained correction value can be improved. Although most high luminance points or low luminance points in an original image are likely to be neutral color portions, the high luminance points or low luminance points in the original image are frequently a minute portion of the area of the original image, and therefore, the portions where high luminance points or low luminance points exist on the original image include high spatial frequency components. In contrast, the density correction of the image is to correct the average value relating to the luminance of the original image to an intermediate value. Consequently, if data indicative of the high luminance points or low luminance points in the original image is included in data for obtaining the correction value for the density correction, the average value relating to the luminance of the original image is liable to fluctuate, thereby inducing deterioration in the accuracy and stability of the density correction.
In an image correcting method according to a first aspect of the present invention, color correction of a original color image is performed by using first image data including higher spatial frequency components of the original color image, and density correction of the original color image is performed by using second image data in which the high frequency component is removed or reduced.
In the first aspect, the color correction is performed on the original color image by using the first image data including the high frequency component of the original color image. Since the first image data includes the high frequency component of the original color image, data of high luminance points or low luminance points of a small area in the original color image, in which a number of data of portions to be a neutral color are included is also stored. Consequently, it is possible to perform the color correction with high accuracy.
Furthermore, in the first aspect, the density correction is performed on the original color image by using the second image data. Since the high frequency component of the original color image is removed from or reduced in the second image data, the variations of the luminance at the portions where the high luminance points or low luminance points exist in the original color image become dull (averaged) in the second image data, thereby preventing or alleviating any adverse effect of the high luminance points or low luminance points in the original color image on the accuracy and stability of the density correction. Consequently, in the first aspect, it is possible to perform the color correction and the density correction with high accuracy all the time.
Some apparatuses for producing image data (for example, a digital still camera for photographing an object so as to produce image data, a scanner for scanning an image recorded on a storage medium such as a photographic film so as to produce image data, or the like) are so constructed as to produce the image data corresponding to the first image data according to the present invention and the image data corresponding to the second image data according to the present invention. Some apparatuses for processing input image data to output it (for example, various image processors, various interface circuits, or the like) are so constructed as to produce the image data corresponding to the second image data according to the present invention upon inputting of the image data corresponding to the first image data according to the present invention so as to output data for each image. According to the present invention claimed in claim 1, there may be used the first image data and the second image data produced by the above-described apparatuses or obtained from the original color image, as described below.
In an image correcting method according to a second aspect, first image data including higher spatial frequency components of the original color image and second image data, in which the high frequency component is removed or reduced, are determined from a original color image; color correction of the original color image is performed by using the first image data; and density correction of the original color image is performed by using the second image data.
In the second aspect, the first image data including the high frequency component of the original color image is determined from the original color image, and the color correction of the original color image is performed by using the first image data. As described above, since the first image data includes the high frequency component of the original color image, the data at the high luminance points or low luminance points of a small area in the original color image, in which a number of data of portions to be a neutral color are included, is also held. Consequently, it is possible to perform the color correction with high accuracy, in the same manner as the first aspect.
Furthermore, in the second aspect, the second image data, from which the high frequency component of the original color image is removed or reduced, is determined from the original color image, and the density correction of the original color image is performed by using the second image data. As described above, since the high frequency component of the original color image is removed from or reduced in the second image data, the variations in luminance at the portions where the high luminance points or low luminance points exist in the original color image become dull (averaged) on the second image data, thereby preventing or alleviating any adverse effect of the high luminance points or low luminance points in the original color image on the accuracy and stability of the density correction. Thus, it is possible to perform the color correction and the density correction with high accuracy all the time according to the present invention of claim 2, in the same manner as the first aspect.
In the case where the original image data representing the original color image is present already, then, for example, the original image data can be used as the first image data as it is, while the second image data can be determined by filtering the original image data so as to remove or reduce the high frequency component. However, as claimed in claim 3, it is preferable that the first image data should be determined by selecting data of one pixel from the original image data representing the original color image every predetermined number of pixels; and that the second image data should be determined by calculating an average value from the original image data every predetermined number of pixels.
In the third aspect, since the first image data is determined by selecting the data of one pixel from the original image data every predetermined number of pixels, it is possible to reduce a quantity of the first image data without deteriorating the high frequency component of the original color image included in the original image data. Furthermore, since the second image data is determined by calculating the average value every predetermined number of pixels based on the original image data, it is possible to obtain the second image data, in which the high frequency component can be removed or reduced without performing any complicated processing such as filtering.
In the third aspect, it is possible to obtain the first image data by obtaining the average value by selecting pixel data from a plurality of pixels every predetermined number of pixels from the original image data instead of by selecting pixel data from one pixel every predetermined number of pixels (the number of the plurality of pixels should desirably not be of a size that the high frequency component of the original image is attenuated).
In an image correcting method according to a fourth aspect, an average value relating to chromaticity per first small region of a minute area at points on a original color image is determined; an average value relating to luminance per second small region greater in area than the first small region at the points on the original color image is determined; color correction of the original color image is performed based on the average value relating to chromaticity; and density correction of the original color image is performed based on the average value relating to luminance.
Since the first small region has a small area, the values indicating the chromaticity of the high luminance points or low luminance points located in the original color image are included at a high rate in the values relating to the chromaticity per first small region at the portions on the original color image. The average value relating to the chromaticity per first small region becomes a value remarkably reflecting the chromaticity of the high luminance points or low luminance points located in the original color image, i.e., the chromaticity at the portions to be a neutral color. According to the present invention of claim 4, since the color of the original color image is corrected based on the average value relating to the chromaticity per first small region having a small area at the portions on the original color image, the color correction can be performed with high accuracy.
Moreover, since the area of the second small region is greater than that of the first small region, the value relating to the luminance per second small region becomes an approximation to the average value relating to the luminance of the original image by averaging the luminance at each portion within the second small region even if the high luminance points or low luminance points exist within the second small region. According to the invention of claim 4, the average value relating to the luminance per second small region is determined at the portions on the original color image, and then, the density of the original color image is corrected based on the average value relating to the luminance, thereby preventing or alleviating any adverse effect of the high luminance points or low luminance points in the original color image on the accuracy and stability of the density correction so as to allow the density correction to be performed with high accuracy. Thus, it is possible to perform the color correction and the density correction with high accuracy all the time according to the fourth aspect, in the same manner as the second aspect.
An image correcting apparatus according to a fifth aspect comprises correction means for performing color correction on a original color image by using first image data including higher spatial frequency components of the original color image, and for performing density correction on the original color image by using second image data in which the high frequency component is removed or reduced.
In the fifth aspect, since the correction means performs the color correction on the original color image by using the first image data including the high frequency component of the original color image and the density correction on the original color image by using the second image data, in which the high frequency component of the original color image is removed or reduced, it is possible to perform the color correction and the density correction with high accuracy all the time, in the same manner as the first aspect.
In the fifth aspect, the first image data used for the color correction by the correction means and the second image data used for the density correction by the correction means may be obtained by, for example, providing acquiring means for acquiring the first image data including the high frequency component of the original color image and the second image data, in which the high frequency component is removed or reduced (for example, acquiring them from an apparatus for producing the above-described image data); otherwise, it may be obtained from the original color image as described below.
That is, an image correcting apparatus according to a sixth aspect comprises: arithmetical means for determining, from a original color image, first image data including higher spatial frequency components of the original color image and second image data in which the high frequency component is removed or reduced; and correction means for performing color correction on the original color image by using the first image data and for performing density correction on the original color image by using the second image data.
In the sixth aspect, the first image data including the high frequency component of the original color image and the second image data, in which the high frequency component of the original color image is removed or reduced, are determined from the original color image by the arithmetical means. The correction means performs the color correction on the original color image by using the first image data and the density correction on the original color image by using the second image data. Therefore, it is possible to perform the color correction and the density correction with high accuracy all the time, in the same manner as the second aspect.
A storage medium according to a seventh aspect stores therein programs for allowing a computer to execute processings including the step of performing color correction on a original color image by using first image data including higher spatial frequency components of the original color image, and the step of performing density correction on the original color image by using second image data in which the high frequency component is removed or reduced.
The storage medium according to the seventh aspect stores the program for allowing the computer to execute the processing including the above steps, i.e., the processings in the image correcting method according to the first aspect. Consequently, the computer reads out the program stored in the storage medium to execute it, so that it is possible to perform the color correction and the density correction with high accuracy all the time, in the same manner as the first aspect.
A storage medium according to an eighth aspect stores therein programs for allowing a computer to execute processings including the first step of determining, from a original color image, first image data including higher spatial frequency components of the original color image and second image data in which the high frequency component is removed or reduced; and the second step of performing color correction on the original color image by using the first image data and performing density correction on the original color image by using the second image data.
The storage medium according to the eighth aspect stores the program for allowing the computer to execute the processings including the above first and second steps, i.e., the processings in the image correcting method according to the second aspect. Consequently, the computer reads out the program stored in the storage medium to execute it, so that it is possible to perform the color correction and the density correction with high accuracy all the time, in the same manner as the second aspect.